package isp.apps.example.shoppingcart.action;

import com.opensymphony.xwork.ActionSupport;

import isp.apps.example.shoppingcart.persistence.ShippingOptionsDirectory;
import isp.apps.example.shoppingcart.persistence.factory.ShippingOptionsPersistenceFactory;

import java.util.List;


public class LoadShippingOptionsAction extends ActionSupport
{

  private List allShippingOptions;
  private List validShippingOptions;
  private ShippingOptionsDirectory shippingDirectory;

  public LoadShippingOptionsAction()
  {
  }

  public String execute()
  {
    shippingDirectory = ShippingOptionsPersistenceFactory.getShippingOptionsDirectory();
    allShippingOptions = shippingDirectory.getAllOptions();
    validShippingOptions = shippingDirectory.getValidOptions();
    return SUCCESS;
  }

  public List getAllShippingOptions()
  {
    return allShippingOptions;
  }

  public List getValidShippingOptions()
  {
    return validShippingOptions;
  }
}
